/**
 * Copyright 2013 Impetus Infotech.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.impetus.client.oraclenosql.entities;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.impetus.kundera.index.Index;
import com.impetus.kundera.index.IndexCollection;

/**
 * Person entity with one embedded attribute
 * 
 * @author amresh.singh
 */
@Entity
@Table(name = "PERSON_EMBEDDED", schema = "OracleNoSqlTests@twikvstore")
@IndexCollection(columns = { @Index(indexName = "compositeIdx", name = "personId,age", type = "composite"),
        @Index(indexName = "personName", name = "personName"), @Index(indexName = "age", name = "age"),
        @Index(indexName = "officeId", name = "office.officeId",type = "composite"),
        @Index(indexName = "companyName", name = "office.companyName",type = "composite"),
        @Index(indexName = "location", name = "office.location",type = "composite") })
public class PersonEmbeddedKVStore
{
    /** The person id. */
    @Id
    @Column(name = "PERSON_ID")
    private String personId;

    /** The person name. */
    @Column(name = "PERSON_NAME")
    private String personName;

    /** The age. */
    @Column(name = "AGE")
    private Integer age;

    @Embedded
    private Office office;

    /**
     * Gets the person id.
     * 
     * @return the person id
     */
    public String getPersonId()
    {
        return personId;
    }

    /**
     * Gets the person name.
     * 
     * @return the person name
     */
    public String getPersonName()
    {
        return personName;
    }

    /**
     * Sets the person name.
     * 
     * @param personName
     *            the new person name
     */
    public void setPersonName(String personName)
    {
        this.personName = personName;
    }

    /**
     * Sets the person id.
     * 
     * @param personId
     *            the new person id
     */
    public void setPersonId(String personId)
    {
        this.personId = personId;
    }

    /**
     * @return the age
     */
    public int getAge()
    {
        return age;
    }

    /**
     * @param age
     *            the age to set
     */
    public void setAge(int age)
    {
        this.age = age;
    }

    /**
     * @return the office
     */
    public Office getOffice()
    {
        return office;
    }

    /**
     * @param office
     *            the office to set
     */
    public void setOffice(Office office)
    {
        this.office = office;
    }

    /**
     * @param age
     *            the age to set
     */
    public void setAge(Integer age)
    {
        this.age = age;
    }

}
